const mongoose= require('mongoose')
const Schema = mongoose.Schema

const ArticleSchema = new Schema({
  // 文章标题
  title: {
    type: String,
    require: true
  },
  // 文章简介
  desc: {
    type: String,
    require: true
  },
  // 文章标签
  tag: {
    type: Array,
    require: true
  },
  // 文章封面
  cover: {
    type: String,
    require: false
  },
  // 文章状态
  state: {
    type: Boolean,
    require: true
  },
  // 文章内容
  content: {
    type: String,
    require: true
  },
  // 阅读数
  look: {
    type: Number,
    require: true
  },
  // 发布时间
  createTime: {
    type: Number,
    require: true
  }
})

module.exports =mongoose.model('Article', ArticleSchema, 'article')